<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Canvas绘图</title>
</head>
<body>
<canvas id="myCavas" width="200" height="200" style="border:1px solid #000">
</canvas>
<script type="text/javascript">
    var canvas=document.getElementById("myCavas");
    var context=canvas.getContext("2d");
    context.fillStyle="#FF6688";
    context.fillRect(30,30,100,100);
</script>
</body>
</html>